package com.atguigu.gmall.order.mapper;

import com.atguigu.gmall.model.order.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
    /**
     * 我的订单
     * @param orderInfoPage
     * @param userId
     * @return
     */
    // 有多个参数时要加@Param，Page<OrderInfo>不加@Param 它自己会识别分页
    IPage<OrderInfo> selectOrderPageByUserId(Page<OrderInfo> orderInfoPage, @Param("userId") String userId);

    /**
     * 我的订单
     * @param orderInfoPage
     * @param userId
     * @param orderStatus - 移动端参数
     * @return
     */
    IPage<OrderInfo> selectOrderPageByUserId(Page<OrderInfo> orderInfoPage, @Param("userId") String userId,@Param("orderStatus") String orderStatus);
}
